package com.jiyun.mapper;

import com.jiyun.entity.Task;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 聪哥哥
 * @since 2023-03-10
 */
public interface TaskMapper extends BaseMapper<Task> {

    @Select("select id from tb_task where pid=#{pid}")
    List<Integer> findTaskChildren(Integer pid);

    @Update("update tb_task set pid=0 where pid=#{pid} ")
    void updateByPid(Integer pid);
}
